home *** CD-ROM | disk | FTP | other *** search
- unit graftext;
-
- interface
-
- type Gfonts = (Thin8,Thin14,Thin16,Brdwy19,Wndw19,Sans19);
-
- var
- pitch : word;
-
-
-
-
- Procedure Gtxttran(gdx,gdy,color:word;st:string);
-
- Procedure Gtxtsol(gdx,gdy,backgnd,color:word;st:string);
-
- Procedure SetGfont(newfont:Gfonts);
-
- Procedure SetYofset(yofs:word); {number of scan lines to scroll up the screen}
-
-
-
- { To Write on areas off the visible screen, consider the graphics page to be a
- virtual space of 640 wide and 819 tall. (64K addresses / (80 bytes/line)
- = 819.2. At EGA resolution, you can have two separate virtual screens of 350
- lines, with space left over. At 480 lines, you can have only 1 independent
- screen (assuming 256K of video memory) }
-
-
-
-
-
- implementation
-
- var
- fontlines : word;
- fontpointer : pointer;
-
- {$L Graftex1}
- Procedure Gtran(gdx,gdy,color,fontlines:word;fontpointer:pointer;var st:string);
- external;
-
-
- {$L Graftex2}
- Procedure Gsol(gdx,gdy,backgnd,color,fontlines:word;fontpointer:pointer;var st:string);
- external;
-
-
- { a transparent text writing routine}
- Procedure Gtxttran(gdx,gdy,color:word;st:string);
-
- begin
-
- Gtran(gdx,gdy,color,fontlines,fontpointer,st);
- end;
-
-
- { a text writing routine with solid background}
- Procedure Gtxtsol(gdx,gdy,backgnd,color:word;st:string);
-
- begin
- Gsol(gdx,gdy,backgnd,color,fontlines,fontpointer,st);
- end;
-
-
-
-
- { Note: other fonts can be linked by converting them to .OBJ files
- to do this use BINOBJ. The supplied 8x8 font was converted as follows:
-
- BINOBJ 8x8.fnt 8x8 Font8
-
- }
-
-
-
-
- {$L 8x8.obj}
- Procedure Font8;
- external;
-
- {$L 8x14.obj}
- Procedure Font14;
- external;
- {$L 8x16.obj}
- Procedure Font16;
- external;
- {$L SANS19.obj}
- Procedure SANS1F19;
- external;
- {$L WNDWS19.obj}
- Procedure WINDOWSF19;
- external;
- {$L BRDW19.obj}
- Procedure BROADWAYF19;
- external;
-
-
- Procedure SetGfont(newfont:Gfonts);
-
- begin
- case newfont of
-
- Thin8 : begin
- fontlines := 8;
- FontPointer := @Font8;
- end;
-
- Thin14 : begin
- fontlines := 14;
- FontPointer := @Font14;
- end;
-
- Thin16 : begin
- fontlines := 16;
- FontPointer := @Font16;
- end;
-
- Brdwy19 : begin
- fontlines := 19;
- FontPointer := @BroadwayF19;
- end;
-
- Wndw19 : begin
- fontlines := 19;
- FontPointer := @WindowsF19;
- end;
-
- Sans19 : begin
- fontlines := 19;
- FontPointer := @Sans1F19;
- end;
-
- end;
- end;
-
-
-
-
-
-
- Procedure SetYofset(yofs:word);
- begin {set CRT controller Start Address hi/low}
- yofs := yofs * 80; {assuming 640 pixels, across screen is 80 bytes}
- port[$3d4] := $C;
- port[$3d5] := hi(yofs);
- port[$3d4] := $D;
- port[$3d5] := lo(yofs);
- end;
-
-
- {the pitch variable allows operation with SuperVGA modes: for example 800x600
- would have a pitch of 100}
-
- begin
- pitch := 80; {default pitch for 640 by x modes }
- Fontlines := 14; {default Font}
- FontPointer := @Font14;
-
- end.